program OD;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
  a,b,c,i :integer;
begin
 readln(a);
 readln(b);
 readln(c);
 if (a>=c) and (b>=c) then
  begin
    for i:=1 to c do
      if (a mod i=0) and (b mod i=0) then
        writeln(i);
  end;
 if (b>=a) and (c>=a) then
  begin
    for i:=1 to c do
      if (c mod i=0) and (b mod i=0) then
        writeln(i);
  end;
 if (c>=b) and (a>=b) then
  begin
    for i:=1 to c do
      if (c mod i=0) and ( a mod i=0) then
        writeln(i);
  end;


 readln;
 end.
